﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using VehicleMaintenance.Comm;

namespace VehicleMaintenance.Models
{
	public class DamageBill
	{
		//ID, GoodID, GoodName, Reason, Date, StaffID, Remark
		[Key]
		public int ID { get; set; }

		[Display(Name = "报损单号")]
		[Required(ErrorMessage = "请填写报损单号")]
		public string Code { get; set; }

		[Required(ErrorMessage = "请选择零件编码")]
		[Display(Name = "零件编码")]
		public int GoodID { get; set; }

		[Required(ErrorMessage = "零件名称不能为空")]
		[Display(Name = "零件名称")]
		public string GoodName { get; set; }

		[Required(ErrorMessage = "报损数量不能为空")]
		[Display(Name = "报损数量")]
		public int Number { get; set; }

		[Display(Name = "单位")]
		public string Units { get; set; }

		[Display(Name = "报损原因")]
		public string Reason { get; set; }

		[Display(Name = "报损日期")]
		[ControlTypeAttribute(Type = "DateTimePicker")]
		public string Date { get; set; }

		[Display(Name = "业务员")]
		[Required(ErrorMessage = "请选择业务员")]
		public int StaffID { get; set; }

		[Display(Name = "备注")]
		public string Remark { get; set; }

		public Goods Good { get; set; }

		public Staff Staff { get; set; }
	}
}
